﻿namespace Pub.Class
{
    using System;

    public class FtpIO
    {
        public static string ValidateEndOfPath(string path)
        {
            if (path.EndsWith("/"))
            {
                return path;
            }
            return (path + "/");
        }

        public static string ValidateStartOfPath(string path)
        {
            string str = "";
            if (path.StartsWith("ftp://"))
            {
                str = path.Replace("ftp://", "");
                return str.Substring(str.IndexOf("/"), str.Length - str.IndexOf("/"));
            }
            if (path.StartsWith("/"))
            {
                return path;
            }
            return ("/" + str);
        }
    }
}

